-- GENERATED SPELL FOR [Unliving Stalker] --


function spell0_18501(pUnit, Event) --@Serpent Sting,n/a--
pUnit:FullCastSpellOnTarget(31975,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18501', 15000, 1)
end

function spell1_18501(pUnit, Event) --@Serpent Sting,n/a--
pUnit:FullCastSpellOnTarget(35511,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18501', 15000, 1)
end

function spell2_18501(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(15547,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18501', 616, 1)
end

function spell3_18501(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(16100,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18501', 592, 1)
end

function spell4_18501(pUnit, Event) --@Spirit Vengeance,n/a--
pUnit:FullCastSpellOnTarget(32829,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18501', 10500, 1)
end

function spell5_18501(pUnit, Event) --@Viper Sting,Drain--
pUnit:FullCastSpellOnTarget(37551,pUnit:GetRandomPlayer(4))
pUnit:RegisterEvent('Sorts_18501', 8000, 1)
end

function Sorts_18501(pUnit, Event)
local choix_sorts_18501 = math.random(0, 5)
if choix_sorts_18501 == 0 then
pUnit:RegisterEvent('spell0_18501', 1, 1)
end
if choix_sorts_18501 == 1 then
pUnit:RegisterEvent('spell1_18501', 1, 1)
end
if choix_sorts_18501 == 2 then
pUnit:RegisterEvent('spell2_18501', 1, 1)
end
if choix_sorts_18501 == 3 then
pUnit:RegisterEvent('spell3_18501', 1, 1)
end
if choix_sorts_18501 == 4 then
pUnit:RegisterEvent('spell4_18501', 1, 1)
end
if choix_sorts_18501 == 5 then
pUnit:RegisterEvent('spell5_18501', 1, 1)
end
end

function mob18501_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18501', math.random(1500, 3000), 1)
end

function mob18501_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18501_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18501_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18501, 1, 'mob18501_Action')
RegisterUnitEvent(18501, 2, 'mob18501_Leave')
RegisterUnitEvent(18501, 3, 'mob18501_Kill')
RegisterUnitEvent(18501, 4, 'mob18501_Die')
